/*
 * (C) Copyright 2023 orchy
 * This file is licensed under the BSD-3-Clause license.
 * <https://spdx.org/licenses/BSD-3-Clause.html>
 */
#ifndef _TIME_H
#define _TIME_H

// # 7.23.1
// ## 7.23.1.2
#ifndef NUll
  #define NULL ((void*)0)
#endif

// ## 7.23.1.3
#ifndef _SIZE_T_DEFINED
  typedef long long int size_t;
  #define _SIZE_T_DEFINED
#endif

typedef int clock_t;
typedef int time_t;
struct tm {
	int tm_sec;
	int tm_min;
	int tm_hour;
	int tm_mday;
	int tm_mon;
	int tm_year;
	int tm_wday;
	int tm_yday;
	int tm_isdst;
};

// # 7.23.2
// ## 7.23.2.1
clock_t clock(void);

// ## 7.23.2.2
double difftime(time_t time1, time_t time0);

// ## 7.23.2.3
time_t mktime(struct tm* timeptr);

// ## 7.23.2.4
time_t time(time_t* timer);

// # 7.23.3
// ## 7.23.3.1
char* asctime(const struct tm* timeptr);

// ## 7.23.3.2
char* ctime(const time_t* timer);

// ## 7.23.3.3
struct tm* gmtime (const time_t *timer);

// ## 7.23.3.4
struct tm* localtime(const time_t* timer);

// ## 7.23.3.5
size_t strftime(char* restrict s, size_t maxsize, const char* restrict format, const struct tm* restrict timeptr);

#endif
